<%@ page contentType= "text/html;charset=utf-8" %>

<html>
<%@ include file="../common/base.jsp" %>
<body>
<div id="container">

	<%@ include file="../common/header.jsp" %>
	
		<div id="menu">
			<a href="<c:url value="/common/home.o"/>"><fmt:message key="Home" /></a> > <fmt:message key="User" />
		        <div  style="float: right" ><fmt:message key="Logged" />: <c:out value="${currentUser.username}" /> (<a href="<c:url value="/common/logout.o"/>"><fmt:message key="Logout" /></a>)</div>
		</div>
	
	<div id="midbody">
	     <div id="leftside">
	     	<br>
		 	<a href="<c:url value="/user/manage.o"/>"><fmt:message key="AllUser" /></a>
		 	<br><br>
		 	<a href="<c:url value="/user/create.o"/>"><fmt:message key="CreateUser" /></a>
	     </div>
	      <div id="rightside">
	    
	       <div id="bigbox">
	        <div class="title clearfix">
	        	<div style="float: left"><fmt:message key="User" /></div>
	        	<%@ include file="../common/hidemenu.jsp" %>
	        </div>
		    <div class="content">
	            <table id="manageUsers">
	            <tr>
	                <th><fmt:message key="Username" /></th>
	                <th><fmt:message key="Email" /></th>
	                <th><fmt:message key="Actions" /></th>
	            </tr>
	              <c:forEach var="user" items="${users}">
	            <tr>
	                <td><c:out value="${user.username}" /></td>
	                <td><c:out value="${user.email}" /></td>
	                <td>
	                	<a href="<c:url value="/user/edit.o?userId=${user.id}"/>"><fmt:message key="Edit" /></a>
	                	<c:if test="${user.id ne 1}">&nbsp;|&nbsp;
	                		<a href="<c:url value="/user/delete.o?userId=${user.id}"/>"><fmt:message key="Delete" /></a>
	                	</c:if>
	                </td>
	            </tr>
	            </c:forEach>
	            </table>
	           </div>
	
	         </div>
	      </div>
	</div>
	<%@ include file="../common/foot.jsp" %>
</div>

</body>
</html>

